<fieldset>
	<legend><?php echo __("Icons")?></legend>
	<div>
	<?php foreach($iconsList as $icon){?>
		<?php 
			echo $html->link($html->image('/geo_images/'.$icon,array('alt'=>$icon,'title'=>$icon)),
				'javascript:void(0)',array('onclick'=>"setIconName(this,'$icon')",'escape'=>false,'title'=>$icon,'class'=>"icon_list"));
		?>
		
	<?php }?>
	</div>
</fieldset>
<?php 
	echo $form->create("MapIcon",array("url"=>"/".$this->params['url']['url']));
	echo $form->input("icon",array("type"=>"hidden"));
	?>
<table>
<tr>
	<th></th>
	<th><?php echo __("Category")?></th>
	<th><?php echo __("Icon")?></th>
</tr>
<?php foreach($categroiesList as $categoryId => $categoryLabel){?>
		<tr>
			<td>
				<?php 
					echo $form->input('MapIcon.category.'.$categoryId,array('type'=>"checkbox",'label'=>false));
				?>
			</td>
			<td>
				<?php echo $categoryLabel?>
			</td>
			<td>
				<?php 
						if(isset($categoryIcons[$categoryId]))
						{
							echo $html->image("/geo_images/".$categoryIcons[$categoryId],array('alt'=>$categoryIcons[$categoryId],'title'=>$categoryIcons[$categoryId]));
						}
				?>
			</td>
		</tr>
<?php }?>
</table>

<?php echo $form->end(__("Submit"))?>
<style type="text/css">
.selected_icon img
{
	border: thick solid;
}
</style>
<script>
	function setIconName(caller,icon)
	{
		$('.icon_list').removeClass("selected_icon")
		$(caller).addClass('selected_icon');
		$('#MapIconIcon').val(icon);
	}
</script>